package com.bincky.pageobject;

import com.bincky.common.BasePage;
import org.openqa.selenium.By;

/**
 * 描述:
 *
 * @author Bincky Liang
 * @date 2021-02-19 20:34:16
 */

public class MySubmittedWorkReportPage extends BasePage {

    //待审批tab被选中的定位
    private By selectedPendingToApprovalTabBy = By.xpath("//div[@aria-selected='true' and text()='待审批']");

    //审批不通过tab被选中的定位
    private By selectedNotApprovalTabBy = By.xpath("//div[@aria-selected='true' and text()='审批不通过']");

    //提交汇报按钮
    private By submitReportButtonBy = By.xpath("//span[text()='提交汇报']/parent::button");

    //提交汇报div框上确定按钮
    private By confirmButtonBy = By.xpath("//span[text()='确 定']/parent::button");

    /**
     * 判断待审批tab被选中的定位存在
     */
    public boolean isSelectedPendingToApprovalTab(){
        return waitForElementPresent(selectedPendingToApprovalTabBy);
    }

    /**
     * 判断审批不通过tab被选中的定位存在
     */
    public boolean isSelectedNotApproval(){
        return waitForElementPresent(selectedNotApprovalTabBy);
    }

    /**
     * 点击提交汇报按钮
     */
    public void clickSubmitReportButton(){
        click(submitReportButtonBy);
    }

    /**
     * 点击div的确定按钮
     */
    public void clickDivConfirmButton(){
        click(confirmButtonBy);
    }
}
